import request from '@/router/axios';

export const removeFile = (id, fileName) => {
  return request({
    url: '/api/blade-oss/oss/endpoint/remove-file',
    method: 'post',
    params: {
      id: id,
      fileName: fileName
    }
  })
}
export const removeFiles = (ids, fileNames) => {
  return request({
    url: '/api/blade-oss/oss/endpoint/remove-files',
    method: 'post',
    params: {
      ids: ids,
      fileNames: fileNames
    }
  })
}

export const removeFilesByLink = (ids, link) => {
  return request({
    url: '/api/blade-oss/oss/endpoint/remove-files-link',
    method: 'post',
    params: {
      ids: ids,
      link: link
    }
  })
}

export const removeFileByName = (fileName) => {
  return request({
    url: '/api/blade-oss/oss/endpoint/remove-file-name',
    method: 'post',
    params: {
      fileName: fileName
    }
  })
}

export const removeFileByLink = (link) => {
  return request({
    url: '/api/blade-oss/oss/endpoint/remove-file-link',
    method: 'post',
    params: {
      link: link
    }
  })
}

export const getContent = (id) => {
  return request({
    url: '/api/blade-oss/oss/endpoint/getContent',
    method: 'get',
    params: {
      id: id
    }
  })
}

export const uploadProgress = () => {
  return request({
    url: '/api/blade-oss/oss/endpoint/uploadProgress',
    method: 'get',
  })
}


export const getFileLink = (name) => {
  return request({
    url: '/api/blade-oss/oss/endpoint/file-link',
    method: 'get',
    params: {
      fileName: name
    }
  })
}
